<template>
  <el-dialog
    :title="textMap[dialogStatus]"
    width="560px"
    :visible.sync="dialogFormVisible"
    :close-on-click-modal="false"
  >
    <el-form
      ref="dataForm"
      :rules="rules"
      :model="form"
      label-position="right"
      label-width="130px"
      v-loading="confirmLoading"
    >
      <el-form-item label="姓名" prop="userName">
        <el-input
          placeholder="请输入你的姓名"
          v-model="form.userName"
        ></el-input>
      </el-form-item>
      <el-form-item label="身份证号" prop="idCard">
        <el-input
          placeholder="请输入你的身份证号"
          v-model="form.idCard"
        ></el-input>
      </el-form-item>
      <el-form-item label="性别" prop="gender">
        <el-input
          placeholder="请输入你的性别"
          v-model="form.gender"
        ></el-input>
      </el-form-item>
      <el-form-item label="企业名称（全称）" prop="orgName">
        <el-input
          placeholder="请输入你的身份证号"
          v-model="form.orgName"
        ></el-input>
      </el-form-item>
      <el-form-item label="类别" prop="examType">
        <el-select
          v-model="form.examType"
          style="width: 100%"
          placeholder="请选择题库"
        >
          <el-option
            v-for="item in examTypeList"
            :key="item"
            :label="item"
            :value="item"
          ></el-option>
        </el-select>
      </el-form-item>
        </el-col>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">
        取消
      </el-button>
      <el-button type="primary" :loading="confirmLoading" @click="submitForm">
        确认
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
import formMixin from "@/mixins/form";
import request from "@/utils/request";
export default {
  name: "Dialog",
  mixins: [formMixin],
  components: {},
  data() {
    const examTypeList=['A', 'B', 'C', 'C1', 'C2', 'C3', "OTHER"]
    return {
      textMap: {
        update: "修改考生信息",
        create: "新增考生信息"
      },
      rules: {
        period: [
          {
            required: true,
            message: "请设置考试期数名称",
            trigger: "blur"
          }
        ],
        startTime: [
          {
            required: true,
            message: "请选择考试开始日期",
            trigger: "change"
          }
        ],
        endTime: [
          {
            required: true,
            message: "请选择考试结束日期",
            trigger: "change"
          }
        ],
        qusLibIds: [
          {
            required: true,
            message: "请选择考试题库",
            trigger: "change"
          }
        ],
        totalScore: [
          {
            required: true,
            message: "请输入满分分值",
            trigger: "blur"
          }
        ],
        passScore: [
          {
            required: true,
            message: "请输入及格分值",
            trigger: "blur"
          }
        ]
      },
      examTypeList,
      Urls: {
        addUrl: "/api/examUser/insert",
        editUrl: "/api/examUser/update/",
        getByIdUrl: "/api/examUser/get/"
      }
    };
  },
  computed: {},
  watch: {},
  methods: {
  },
  created() {},
  mounted() {},
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  activated() {}
};
</script>
<style lang="scss" scoped></style>
